package com.sgb.kjwl.model.entity.transport;

import android.text.TextUtils;

import com.sgb.kjwl.utils.NumberUtil;
import com.swgk.core.util.DateUtils;

import java.util.List;

/**
 * @author: 杨畔
 * @date: 4/15/21 12:10 PM
 * @Description: 货主工作台数据
 */
public class OwnerWorkbenchEntity {


    /**
     * carrierCount : 0
     * messageList : [{"destCityName":"成都","districtName":"武侯","freight":200,"userNo":"1372117856052973568","destProvinceName":"四川","updateTime":null,"content":"车主张梦可在装货，车型7车型长0.1米，运费意向200.00元/吨，如有装货需求可联系","destDistrictName":"武侯","cityName":"成都","carrierNo":"1382544539117555712","carLen":"0.1米","provinceName":"四川","carrierId":1330,"shipmentStartTime":1618416000000,"carTypeName":"车型7"},{"destCityName":"成都","districtName":"武侯","freight":200,"userNo":"1372117856052973568","destProvinceName":"四川","updateTime":null,"content":"车主张梦可在装货，车型7车型长0.1米，运费意向200.00元/吨，如有装货需求可联系","destDistrictName":"武侯","cityName":"成都","carrierNo":"1382544539117555712","carLen":"0.1米","provinceName":"四川","carrierId":1330,"shipmentStartTime":1618416000000,"carTypeName":"车型7"}]
     * latelyGoodsSource : {"sourceId":null,"messagePrice":null,"destCityName":"重庆","districtName":"东城","freight":10,"userNo":"","pattern":null,"weight":null,"destProvinceName":"重庆","sourceNo":"","updateTime":null,"content":"","destDistrictName":"万州","volume":null,"cityName":"北京","goodsModeName":"","shipmentEndTime":1619884799000,"provinceName":"北京","state":0,"shipmentStartTime":1618416000000}
     */

    private int carrierCount;
    /**
     * sourceId : null
     * messagePrice : null
     * destCityName : 重庆
     * districtName : 东城
     * freight : 10.0
     * userNo :
     * pattern : null
     * weight : null
     * destProvinceName : 重庆
     * sourceNo :
     * updateTime : null
     * content :
     * destDistrictName : 万州
     * volume : null
     * cityName : 北京
     * goodsModeName :
     * shipmentEndTime : 1619884799000
     * provinceName : 北京
     * state : 0
     * shipmentStartTime : 1618416000000
     */

    private LatelyGoodsSourceBean latelyGoodsSource;
    /**
     * destCityName : 成都
     * districtName : 武侯
     * freight : 200.0
     * userNo : 1372117856052973568
     * destProvinceName : 四川
     * updateTime : null
     * content : 车主张梦可在装货，车型7车型长0.1米，运费意向200.00元/吨，如有装货需求可联系
     * destDistrictName : 武侯
     * cityName : 成都
     * carrierNo : 1382544539117555712
     * carLen : 0.1米
     * provinceName : 四川
     * carrierId : 1330
     * shipmentStartTime : 1618416000000
     * carTypeName : 车型7
     */

    private List<MessageListBean> messageList;

    public int getCarrierCount() {
        return carrierCount;
    }

    public void setCarrierCount(int carrierCount) {
        this.carrierCount = carrierCount;
    }

    public LatelyGoodsSourceBean getLatelyGoodsSource() {
        return latelyGoodsSource;
    }

    public void setLatelyGoodsSource(LatelyGoodsSourceBean latelyGoodsSource) {
        this.latelyGoodsSource = latelyGoodsSource;
    }

    public List<MessageListBean> getMessageList() {
        return messageList;
    }

    public void setMessageList(List<MessageListBean> messageList) {
        this.messageList = messageList;
    }

    public static class LatelyGoodsSourceBean {
        private Integer sourceId;
        private Double messagePrice;
        private String destCityName;
        private String districtName;
        private Double freight;
        private String userNo;
        //货源发布模式 0 普通  1 竞价
        private Integer pattern;
        private String weight;
        private String destProvinceName;
        private String sourceNo;
        private Long updateTime;
        private String content;
        private String destDistrictName;
        private String volume;
        private String cityName;
        private String goodsModeName;
        private String secondGoodsTypeName;
        private Long shipmentEndTime;
        private String provinceName;
        private Integer state;
        private Long shipmentStartTime;
        private Integer freightUnit;
        //2.0.6新增字段 begin
        private Integer freightType;//运费选项 0一口价 1电议
        private Integer transportType;//用车类型 0 零担 1 整车
        private Integer startPointTime;//装货时间点
        private Integer endPointTime;//装货结束时间点
        //2.0.6新增字段 end

        public Integer getSourceId() {
            return sourceId;
        }

        public void setSourceId(Integer sourceId) {
            this.sourceId = sourceId;
        }

        public Double getMessagePrice() {
            return messagePrice;
        }

        public void setMessagePrice(Double messagePrice) {
            this.messagePrice = messagePrice;
        }

        public String getDestCityName() {
            return destCityName;
        }

        public void setDestCityName(String destCityName) {
            this.destCityName = destCityName;
        }

        public String getDistrictName() {
            return districtName;
        }

        public void setDistrictName(String districtName) {
            this.districtName = districtName;
        }

        public Double getFreight() {
            return freight;
        }

        public void setFreight(Double freight) {
            this.freight = freight;
        }

        public String getUserNo() {
            return userNo;
        }

        public void setUserNo(String userNo) {
            this.userNo = userNo;
        }

        public Integer getPattern() {
            return pattern;
        }

        public void setPattern(Integer pattern) {
            this.pattern = pattern;
        }

        public String getWeight() {
            if (TextUtils.isEmpty(weight)) {
                return "";
            }
            return NumberUtil.trim0(weight) + "吨";
        }

        public void setWeight(String weight) {
            this.weight = weight;
        }

        public String getDestProvinceName() {
            return destProvinceName;
        }

        public void setDestProvinceName(String destProvinceName) {
            this.destProvinceName = destProvinceName;
        }

        public String getSourceNo() {
            return sourceNo;
        }

        public void setSourceNo(String sourceNo) {
            this.sourceNo = sourceNo;
        }

        public Long getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(Long updateTime) {
            this.updateTime = updateTime;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getDestDistrictName() {
            return destDistrictName;
        }

        public void setDestDistrictName(String destDistrictName) {
            this.destDistrictName = destDistrictName;
        }

        public String getVolume() {
            if (volume == null) {
                return "";
            }
            return NumberUtil.trim0(volume) + "方";
        }

        public void setVolume(String volume) {
            this.volume = volume;
        }

        public String getCityName() {
            return cityName;
        }

        public void setCityName(String cityName) {
            this.cityName = cityName;
        }

        public String getGoodsModeName() {
            return goodsModeName;
        }

        public void setGoodsModeName(String goodsModeName) {
            this.goodsModeName = goodsModeName;
        }

        public String getSecondGoodsTypeName() {
            return TextUtils.isEmpty(secondGoodsTypeName) ? "" : secondGoodsTypeName;
        }

        public void setSecondGoodsTypeName(String secondGoodsTypeName) {
            this.secondGoodsTypeName = secondGoodsTypeName;
        }

        public String getGoodsLastTypeName() {
            String name = "";
            if (!TextUtils.isEmpty(secondGoodsTypeName)) {
                name = secondGoodsTypeName;
            } else if (!TextUtils.isEmpty(goodsModeName)) {
                name = goodsModeName;
            }
            return name;
        }

        public Long getShipmentEndTime() {
            return shipmentEndTime;
        }

        public void setShipmentEndTime(Long shipmentEndTime) {
            this.shipmentEndTime = shipmentEndTime;
        }

        public String getProvinceName() {
            return provinceName;
        }

        public void setProvinceName(String provinceName) {
            this.provinceName = provinceName;
        }

        public Integer getState() {
            return state;
        }

        public void setState(Integer state) {
            this.state = state;
        }

        public Long getShipmentStartTime() {
            return shipmentStartTime;
        }

        public void setShipmentStartTime(Long shipmentStartTime) {
            this.shipmentStartTime = shipmentStartTime;
        }

        /**
         * 获取装货起始时间
         * @return
         */
        public String getShipmentTimeStr() {
            String startTime = DateUtils.stampToDay4(getShipmentStartTime());
            String endTime = DateUtils.stampToDay4(getShipmentEndTime());
            if (startTime.equals(endTime)) {
                return startTime;
            } else {
                return startTime + "-" + endTime;
            }
        }

        public Integer getFreightUnit() {
            return freightUnit;
        }

        public void setFreightUnit(Integer freightUnit) {
            this.freightUnit = freightUnit;
        }

        public String getFreightUnitType() {
            String str = "";//*1：元/趟，2：元/吨，3：元/方
            if (freightUnit == null) {
                str = "元/吨";
                return str;
            }
            switch (freightUnit) {
                case 1:
                    str = "元/趟";
                    break;
                case 2:
                    str = "元/吨";
                    break;
                case 3:
                    str = "元/方";
                    break;
            }
            return str;
        }

        public Integer getFreightType() {
            return freightType;
        }

        public void setFreightType(Integer freightType) {
            this.freightType = freightType;
        }

        public Integer getTransportType() {
            return transportType;
        }

        public void setTransportType(Integer transportType) {
            this.transportType = transportType;
        }

        public Integer getStartPointTime() {
            return startPointTime;
        }

        public void setStartPointTime(Integer startPointTime) {
            this.startPointTime = startPointTime;
        }

        public Integer getEndPointTime() {
            return endPointTime;
        }

        public void setEndPointTime(Integer endPointTime) {
            this.endPointTime = endPointTime;
        }
    }

    public static class MessageListBean {
        private String destCityName;
        private String districtName;
        private Double freight;
        private String userNo;
        private String destProvinceName;
        private Long updateTime;
        private String content;
        private String destDistrictName;
        private String cityName;
        private String carrierNo;
        private String carLen;
        private String provinceName;
        private String carrierId;
        private Long shipmentStartTime;
        private String carTypeName;

        public String getDestCityName() {
            return destCityName;
        }

        public void setDestCityName(String destCityName) {
            this.destCityName = destCityName;
        }

        public String getDistrictName() {
            return districtName;
        }

        public void setDistrictName(String districtName) {
            this.districtName = districtName;
        }

        public Double getFreight() {
            return freight;
        }

        public void setFreight(Double freight) {
            this.freight = freight;
        }

        public String getUserNo() {
            return userNo;
        }

        public void setUserNo(String userNo) {
            this.userNo = userNo;
        }

        public String getDestProvinceName() {
            return destProvinceName;
        }

        public void setDestProvinceName(String destProvinceName) {
            this.destProvinceName = destProvinceName;
        }

        public Long getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(Long updateTime) {
            this.updateTime = updateTime;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getDestDistrictName() {
            return destDistrictName;
        }

        public void setDestDistrictName(String destDistrictName) {
            this.destDistrictName = destDistrictName;
        }

        public String getCityName() {
            return cityName;
        }

        public void setCityName(String cityName) {
            this.cityName = cityName;
        }

        public String getCarrierNo() {
            return carrierNo;
        }

        public void setCarrierNo(String carrierNo) {
            this.carrierNo = carrierNo;
        }

        public String getCarLen() {
            return carLen;
        }

        public void setCarLen(String carLen) {
            this.carLen = carLen;
        }

        public String getProvinceName() {
            return provinceName;
        }

        public void setProvinceName(String provinceName) {
            this.provinceName = provinceName;
        }

        public String getCarrierId() {
            return carrierId;
        }

        public void setCarrierId(String carrierId) {
            this.carrierId = carrierId;
        }

        public Long getShipmentStartTime() {
            return shipmentStartTime;
        }

        public void setShipmentStartTime(Long shipmentStartTime) {
            this.shipmentStartTime = shipmentStartTime;
        }

        public String getCarTypeName() {
            return carTypeName;
        }

        public void setCarTypeName(String carTypeName) {
            this.carTypeName = carTypeName;
        }
    }
}
